import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'

//v-uni-app ui 组件
import VButton from "@/components/model/native/v-button/v-button.vue"
import VTextButton from "@/components/model/native/v-text-button/v-text-button.vue"
import VInput from "@/components/model/native/v-input/v-input.vue"
import VPickerList from "@/components/model/compound/v-picker-list/v-picker-list.vue"
import VSeriesPickerList from "@/components/model/compound/v-series-picker-list/v-series-picker-list.vue"
import VRadio from "@/components/model/native/v-radio/v-radio.vue"
import VCheckbox from '@/components/model/native/v-checkbox/v-checkbox.vue'
import VTextarea from '@/components/model/native/v-textarea/v-textarea.vue'
import VTag from '@/components/model/native/v-tag/v-tag.vue'
import VBadge from '@/components/model/native/v-badge/v-badge.vue'
import VText from '@/components/model/native/v-text/v-text.vue'
import VLoading from '@/components/model/native/v-loading/v-loading.vue'
import VRow from '@/components/layout/v-row/v-row.vue'
import VList from '@/components/layout/v-list/v-list.vue'
import VWindow from '@/components/model/native/v-window/v-window.vue'
import VDialog from '@/components/model/compound/v-dialog/v-dialog.vue'
import VSelectPicker from '@/components/model/compound/v-select-picker/v-select-picker.vue'
import VSeriesSelectPicker from '@/components/model/compound/v-series-select-picker/v-series-select-picker.vue'
import VTabs from '@/components/model/native/v-tabs/v-tabs.vue'
import VCarousel from '@/components/model/native/v-carousel/v-carousel.vue'
import VTabsPage from '@/components/model/compound/v-tabs-page/v-tabs-page.vue'
import VPages from '@/components/model/compound/v-pages/v-pages.vue'
import VInfiniteScroll from '@/components/layout/v-infinite-scroll/v-infinite-scroll.vue'
import VRadioGroup from '@/components/model/compound/v-radio-group/v-radio-group.vue'
import VCheckboxGroup from '@/components/model/compound/v-checkbox-group/v-checkbox-group.vue'
import VUploadFileButton from "@/components/model/native/v-upload-file-button/v-upload-file-button.vue"
import VForm from '@/components/model/compound/v-form/v-form.vue'
import VFormItem from '@/components/model/compound/v-form-item/v-form-item.vue'
import VMenu from '@/components/model/native/v-menu/v-menu.vue'
import VMenuSlide from '@/components/model/native/v-menu-slide/v-menu-slide.vue'
import VPopup from '@/components/model/compound/v-popup/v-popup.vue'
import VGrid from '@/components/layout/v-grid/v-grid.vue'
import VIconGrid from '@/components/layout/v-icon-grid/v-icon-grid.vue'
import VWaterfall from '@/components/layout/v-waterfall/v-waterfall.vue'
import VCard from '@/components/layout/v-card/v-card.vue'
import VTable from "@/components/model/native/v-table/v-table.vue"
import VOverlay from '@/components/model/native/v-overlay/v-overlay.vue'
import VSwitch from '@/components/model/compound/v-switch/v-switch.vue'
import VHeaderNavigationBar from '@/components/model/native/v-header-navigation-bar/v-header-navigation-bar.vue'
import VMinLoading from '@/components/model/native/v-min-loading/v-min-loading.vue'
import VPullUpRefresh from '@/components/model/native/v-pull-up-refresh/v-pull-up-refresh.vue'
import VNull from '@/components/model/native/v-null/v-null.vue'
import VDateTime from '@/components/model/compound/v-date-time/v-date-time.vue'
import VDrumSelectPicker from '@/components/model/compound/v-drum-select-picker/v-drum-select-picker.vue'
import VScrollList from '@/components/model/native/v-scroll-list/v-scroll-list.vue'
import VInputCode from '@/components/model/native/v-input-code/v-input-code.vue'
import VCollapse from '@/components/model/native/v-collapse/v-collapse.vue'
import VSteps from "@/components/model/native/v-steps/v-steps.vue"
import VTitle from '@/components/model/native/v-title/v-title.vue'
import VImage from '@/components/model/compound/v-image/v-image.vue'
import VToast from "@/components/model/native/v-toast/v-toast.vue"

//配置文件
import {
	config
} from '@/components/config'


let toastInstance = null;

export function createApp() {
	const app = createSSRApp(App)
	//批量注册组件
	app.component('VButton', VButton);
	app.component('VTextButton', VTextButton);
	app.component('VInput', VInput);
	app.component('VPickerList', VPickerList);
	app.component('VSeriesPickerList', VSeriesPickerList);
	app.component('VRadio', VRadio);
	app.component('VCheckbox', VCheckbox);
	app.component('VTextarea', VTextarea);
	app.component('VTag', VTag);
	app.component('VBadge', VBadge);
	app.component('VText', VText);
	app.component('VLoading', VLoading);
	app.component('VRow', VRow);
	app.component('VList', VList);
	app.component('VWindow', VWindow);
	app.component('VDialog', VDialog);
	app.component('VSelectPicker', VSelectPicker);
	app.component('VSeriesSelectPicker', VSeriesSelectPicker);
	app.component('VTabs', VTabs);
	app.component('VCarousel', VCarousel);
	app.component('VTabsPage', VTabsPage);
	app.component('VPages', VPages);
	app.component('VInfiniteScroll', VInfiniteScroll);
	app.component('VRadioGroup', VRadioGroup);
	app.component('VCheckboxGroup', VCheckboxGroup);
	app.component('VUploadFileButton', VUploadFileButton);
	app.component('VForm', VForm);
	app.component('VFormItem', VFormItem);
	app.component('VPopup', VPopup);
	app.component('VOverlay', VOverlay);
	app.component('VMenu', VMenu);
	app.component('VGrid', VGrid);
	app.component('VIconGrid', VIconGrid);
	app.component('VWaterfall', VWaterfall);
	app.component('VCard', VCard);
	app.component('VTable', VTable);
	app.component('VSwitch', VSwitch);
	app.component('VHeaderNavigationBar', VHeaderNavigationBar);
	app.component('VMinLoading', VMinLoading);
	app.component('VPullUpRefresh', VPullUpRefresh);
	app.component('VNull', VNull);
	app.component('VDrumSelectPicker', VDrumSelectPicker);
	app.component('VScrollList', VScrollList);
	app.component('VInputCode', VInputCode);
	app.component('VCollapse', VCollapse);
	app.component('VSteps', VSteps);
	app.component('VTitle', VTitle);
	app.component('VImage', VImage);
	app.component('VToast', VToast);
	app.component('VMenuSlide', VMenuSlide);


	// //配置文件
	app.provide('config', config);



	return {
		app
	}
}
// #endif